﻿// Decompiled by AS3 Sorcerer 6.12
// www.as3sorcerer.com

//Tendril

package 
{
    import flash.display.Graphics;
    import flash.events.Event;

    public class Tendril extends Node 
    {

        public static const TYPE_WITHOUT_SPOT:int = 0;
        public static const TYPE_WITH_SPOT:int = 1;

        private var _SafeStr_282:Number = 1;
        private var _SafeStr_283:Number = 0;
        private var _SafeStr_95:Number = 0;
        private var _SafeStr_121:Sync = null;
        private var _SafeStr_118:uint = 0xFFFFFF;
        private var _SafeStr_274:Number = 0;
        private var _SafeStr_284:Number = 0;
        private var _SafeStr_285:Boolean = false;

        public function Tendril(_arg_1:int, baseRadius:Number, angle:int, size:Number, moveSize:Number, moveOffset:Number=0, moveDir:Boolean=false, sync:Sync=null)
        {
            super(baseRadius, angle);
            this._SafeStr_121 = ((sync != null) ? sync : new Sync(0.2));
            this._SafeStr_285 = ((sync == null) ? true : false);
            this._SafeStr_95 = _arg_1;
            this._SafeStr_274 = size;
            this._SafeStr_283 = moveSize;
            this._SafeStr_284 = moveOffset;
            this._SafeStr_282 = ((moveDir) ? 1 : -1);
        }

        public function setColor(color:uint):void
        {
            this._SafeStr_118 = color;
        }

        public function setSize(size:Number):void
        {
            this._SafeStr_274 = size;
        }

        private function _SafeStr_93():void
        {
            var g:Graphics = graphics;
            var centerRadius:Number = (_SafeStr_33 + (this._SafeStr_274 / 2));
            var endRadius:Number = (_SafeStr_33 + this._SafeStr_274);
            var endAngle:Number = (_SafeStr_32 + ((this._SafeStr_282 * this._SafeStr_283) * (Math.sin(this._SafeStr_121.phase) - this._SafeStr_284)));
            var beginX:Number = (Math.cos(_SafeStr_32) * _SafeStr_33);
            var beginY:Number = (Math.sin(_SafeStr_32) * _SafeStr_33);
            var midX:Number = (Math.cos(_SafeStr_32) * centerRadius);
            var midY:Number = (Math.sin(_SafeStr_32) * centerRadius);
            var endX:Number = (Math.cos(endAngle) * endRadius);
            var endY:Number = (Math.sin(endAngle) * endRadius);
            g.clear();
            g.lineStyle(1, GUI.OUTLINE_COLOR);
            g.moveTo(beginX, beginY);
            g.curveTo(midX, midY, endX, endY);
            if (this._SafeStr_95 == TYPE_WITH_SPOT)
            {
                g.lineStyle(1, GUI.OUTLINE_COLOR);
                g.beginFill(this._SafeStr_118);
                g.drawCircle(endX, endY, 3);
                g.endFill();
            };
        }

        override protected function onEnterFrame(event:Event):void
        {
            if (this._SafeStr_285)
            {
                this._SafeStr_121.tick();
            };
            this._SafeStr_93();
        }

        override public function destruct():void
        {
            super.destruct();
        }


    }
}//package 

// _SafeStr_118 = "_-BS" (String#5202, DoABC#2)
// _SafeStr_121 = "_-Ao" (String#5173, DoABC#2)
// _SafeStr_274 = "_-2U" (String#4774, DoABC#2)
// _SafeStr_282 = "_-0l" (String#4688, DoABC#2)
// _SafeStr_283 = "_-5U" (String#4910, DoABC#2)
// _SafeStr_284 = "_-Ap" (String#5174, DoABC#2)
// _SafeStr_285 = "_-3W" (String#4820, DoABC#2)
// _SafeStr_32 = "_-CB" (String#5234, DoABC#2)
// _SafeStr_33 = "_-0A" (String#4663, DoABC#2)
// _SafeStr_93 = "_-1j" (String#4736, DoABC#2)
// _SafeStr_95 = "_-5e" (String#4918, DoABC#2)


